#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <vector>
#include <queue>
#include <algorithm>

#define FOR(i,a,n) for(int i=a,_n(n);i<_n;++i)
#define REP(i,n) FOR(i,0,n)
#define x first
#define y second

using namespace std;

const double EPS = 1e-7;

typedef pair<double,double> Point;
bool operator == (Point pa, Point pb)
{
    return  fabs(pa.x-pb.x)<EPS&&fabs(pa.y-pb.y)<EPS;
}

Point point[8];
vector<int> mask;

void Dfs(int dep,int state,int preCnt)
{
    if(dep>8||preCnt+(8-dep)<4) return;
    if(preCnt==4)
    {
        mask.push_back(state);
        return;
    }
    else
    {
        Dfs(dep+1,state|(1<<dep),preCnt+1);
        Dfs(dep+1,state,preCnt);
    }
}
void Init()
{
    Dfs(0,0,0);
}

class Segment
{
    Point point[2];
public:
    Segment(Point pa, Point pb)
    {
        point[0] = pa;
        point[1] = pb;
    }
    Point GetMidPoint()
    {
        return Point((point[0].x+point[1].x)/2,
                     (point[0].y+point[1].y)/2);
    }
    double Length()
    {
        double tx = point[0].x-point[1].x;
        double ty = point[0].y-point[1].y;
        return sqrt(tx*tx+ty*ty);
    }
    bool Vertical(Segment &sb)
    {
        double x1 = point[0].x-point[1].x;
        double y1 = point[0].y-point[1].y;
        double x2 = sb.point[0].x-sb.point[1].x;
        double y2 = sb.point[0].y-sb.point[1].y;
        return x1*x2+y1*y2==0;
    }
};
class Rect
{
    Point point[4];
public:
    Rect(Point pa, Point pb, Point pc, Point pd)
        {
            point[0] = (pa), point[1] = (pb);
            point[2] = (pc), point[3] = (pd);
        }
    bool IsRectangle()
    {
        Segment la = Segment(point[0],point[1]);
        Segment lb = Segment(point[2],point[3]);
        if(la.Length()==lb.Length()&&la.GetMidPoint()==lb.GetMidPoint()) return true;
        la = Segment(point[0],point[2]);
        lb = Segment(point[1],point[3]);
        if(la.Length()==lb.Length()&&la.GetMidPoint()==lb.GetMidPoint()) return true;
        la = Segment(point[0],point[3]);
        lb = Segment(point[1],point[2]);
        if(la.Length()==lb.Length()&&la.GetMidPoint()==lb.GetMidPoint()) return true;
        return false;
    }
    bool IsSquare()
    {
        Segment la = Segment(point[0],point[1]);
        Segment lb = Segment(point[2],point[3]);
        if(la.Length()==lb.Length()&&la.GetMidPoint()==lb.GetMidPoint()&&
           la.Vertical(lb)) return true;
        la = Segment(point[0],point[2]);
        lb = Segment(point[1],point[3]);
        if(la.Length()==lb.Length()&&la.GetMidPoint()==lb.GetMidPoint()&&
           la.Vertical(lb)) return true;
        la = Segment(point[0],point[3]);
        lb = Segment(point[1],point[2]);
        if(la.Length()==lb.Length()&&la.GetMidPoint()==lb.GetMidPoint()&&
           la.Vertical(lb)) return true;
        return false;
    }
};

void PrintAns()
{
    REP(i,mask.size())
    {
        int msk = mask[i];
        vector<int> pos[2];
        REP(off,8)
        if(msk&(1<<off)) pos[0].push_back(off);
        else pos[1].push_back(off);
        Rect rect(point[pos[0][0]],point[pos[0][1]],
                  point[pos[0][2]],point[pos[0][3]]);
        Rect square(point[pos[1][0]],point[pos[1][1]],
                  point[pos[1][2]],point[pos[1][3]]);
        if(rect.IsRectangle()&&square.IsSquare())
        {
            puts("YES");
            REP(i,3) printf("%d ",pos[1][i]+1);printf("%d\n",pos[1][3]+1);
            REP(i,3) printf("%d ",pos[0][i]+1);printf("%d\n",pos[0][3]+1);
            return;
        }
    }
    puts("NO");
}

int main()
{
    Init();
    while(cin>>point[0].x>>point[0].y)
    {
        FOR(i,1,8) cin>>point[i].x>>point[i].y;
        PrintAns();
    }
	return 0;
}
